package com.shuqi.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;

import com.shuqi.activity.viewport.CommonTitle;
import com.shuqi.controller.R;
import com.shuqi.statistics.StatisticsEventID;
import com.shuqi.statistics.StatisticsUtils;

public class FastRegisterActivity extends ActivityBase implements OnClickListener {

    private RelativeLayout mLayoutMobile = null;
    private RelativeLayout mLayoutMail = null;
    private CommonTitle mTitle;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_fast_register);

        initView();
    }

    private void initView() {
        mTitle = (CommonTitle) findViewById(R.id.title);
        mTitle.setLeftClickListener(this);
        mLayoutMobile = (RelativeLayout) findViewById(R.id.mobile_register);
        mLayoutMail = (RelativeLayout) findViewById(R.id.mail_register);
        // mLayoutSina = (RelativeLayout) findViewById(R.id.sina_register);

        mLayoutMobile.setOnClickListener(this);
        mLayoutMail.setOnClickListener(this);
        // mLayoutSina.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.title_left:
                ActivityManager.getInstance().finishActivity(this);
                break;
            case R.id.mobile_register:
                StatisticsUtils.onEvent(FastRegisterActivity.this,
                        StatisticsEventID.ACCOUNT_MOBLE_RIGISTER);
                Intent intent = new Intent(FastRegisterActivity.this, MobileRegisterActivity.class);
                ActivityManager.getInstance().startNextActivity(intent, this);
                break;
            case R.id.mail_register:
                StatisticsUtils.onEvent(FastRegisterActivity.this,
                        StatisticsEventID.ACCOUNT_MAIL_RIGISTER);
                Intent intent1 = new Intent(FastRegisterActivity.this, MailRegisterActivity.class);
                ActivityManager.getInstance().startNextActivity(intent1, this);
                break;

            default:
                break;
        }

    }

    @Override
    public void activityLogicForward() {

    }

    @Override
    public void activityInitData() {

    }
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            ActivityManager.getInstance().finishActivity(this);
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
